package com.anng.hosp.service.impl;

import com.anng.hosp.mapper.HospitalSetMapper;
import com.anng.hosp.model.hosp.HospitalSet;
import com.anng.hosp.service.HospitalSetService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

@Service
public class HospitalSetServiceImpl extends ServiceImpl<HospitalSetMapper, HospitalSet> implements HospitalSetService {

    //2.根据传递过来的医院编码，查询数据库 ，并查询签名
    @Override
    public String getSignKey(String hoscode) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("hoscode",hoscode);//查询的要求是hoscode的值与传过来的hoscode相同

        //把queryWrapper传过去就查到啦hospitalSet
        HospitalSet hospitalSet = baseMapper.selectOne(queryWrapper);

        return hospitalSet.getSignKey();//查到哪家医院之后 调用它的签名并且返回

    }
}
